﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class MyMaster : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack == false)
        {
            if ((Session["KhachHang"] as DataTable).Rows.Count == 0)
            {
                hypDangNhap.Visible = true;
                hypDoiMatKhau.Visible = false;
                hypDangKy.Visible = true;
                hypDangXuat.Visible = false;
            }
            else
            {
                hypDangNhap.Visible = false;
                hypDoiMatKhau.Visible = true;
                hypDangKy.Visible = false;
                hypDangXuat.Visible = true;
            }
        }
    }

    protected void hypDangXuat_Click(object sender, EventArgs e)
    {
        Session["KhachHang"] = new DataTable();
        Response.Write("<script>alert('Tạm biệt! Hẹn gặp lại.')</script>");
        Server.Transfer("~/Default.aspx");
    }
}
